package srcSAT;

import java.io.Serializable;

public class Pair implements Serializable
{
    /**
     * serialVersionUID is a universal version identifier for a Serializable
     * class. Deserialization uses this number to ensure that a loaded class
     * corresponds exactly to a serialized object. If no match is found during
     * deserialization, an InvalidClassException is thrown.
     */
    private static final long serialVersionUID = -3763638300302469804L;
    
    private int x;
    private int y;
    
    public Pair(int x, int y) 
    {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object obj) 
    {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Pair other = (Pair) obj;
        if (x != other.x)
            return false;
        if (y != other.y)
            return false;
        return true;
    }

    @Override
    public int hashCode() 
    {
        final int prime = 31;
        int result = 1;
        result = prime * result + x;
        result = prime * result + y;
        return result;
    }

    @Override
    public String toString() 
    {
        return String.format("Pair [x=%s, y=%s]", x, y);
    }

    public int X() 
    {
        return x;
    }

    public int Y() 
    {
        return y;
    }
}
